package fr.blogger.web.bean.module;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

import fr.blogger.ejb.facade.ArticleFacade;
import fr.blogger.ejb.model.Article;
import fr.blogger.web.outils.UtilsJsf;

@Named
@ViewScoped
public class AfficherArticleBean implements Serializable {
	
	@Inject
	private ArticleFacade articleFacade;
	private Article article;
	
	public AfficherArticleBean() {
	}
	
	@PostConstruct
	private void initialisation() {
		String slug = UtilsJsf.getRequestParameter("articleSlug");
		article = articleFacade.findBySlug(slug);
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

}
